﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucComment" TagName="Comment" Src="../Common/Inc/Comment.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Mny4011b.aspx.cs" Inherits="Updms.Mny.Mny4011b" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Mny4011b] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Mny4011b" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_close" Text="닫기" runat="server" CssClass="ibtn ibtn_close" OnClientClick="javascript:window.close();return false;"></asp:linkbutton>
				<asp:linkbutton id="ibtn_cancel" Text="취소" runat="server" CssClass="ibtn ibtn_cancel" OnClientClick="return chkCancel()" OnClick="ibtn_cancel_Click" />
				<asp:linkbutton id="ibtn_finish" Text="마감" runat="server" CssClass="ibtn ibtn_finish" OnClientClick="return chkSave()" OnClick="ibtn_finish_Click" />
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClick="ibtn_search_Click" />
			</div>
			<!-- 버튼 끝 -->
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="22%"><asp:Literal id="ltr_search_close_ym" Text="마감월" runat="server" /></td>
					<td class="ctl" width="33%"><asp:dropdownlist id="ddl_year" style="margin-right:1px;" runat="server"></asp:dropdownlist><asp:dropdownlist id="ddl_month" runat="server">
							<asp:ListItem Value="01">01</asp:ListItem>
							<asp:ListItem Value="02">02</asp:ListItem>
							<asp:ListItem Value="03">03</asp:ListItem>
							<asp:ListItem Value="04">04</asp:ListItem>
							<asp:ListItem Value="05">05</asp:ListItem>
							<asp:ListItem Value="06">06</asp:ListItem>
							<asp:ListItem Value="07">07</asp:ListItem>
							<asp:ListItem Value="08">08</asp:ListItem>
							<asp:ListItem Value="09">09</asp:ListItem>
							<asp:ListItem Value="10">10</asp:ListItem>
							<asp:ListItem Value="11">11</asp:ListItem>
							<asp:ListItem Value="12">12</asp:ListItem>
						</asp:dropdownlist></td>
						<td class="lbl" width="22%"><asp:Literal id="ltr_monthly_balance" Text="잔액" runat="server" /></td>
						<td class="ctl" width="33%" style="padding:1px;"><asp:TextBox ID="txt_monthly_balance" CssClass="ib_read_only_R" runat="server"></asp:TextBox></td>
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 디테일 시작 -->
			<table id="tbl_save" runat="server" class="table_detail">
				<tr>
					<td class="lbl_c" width="6%">S</td>
					<td class="lbl_c" width="40%"><asp:Literal id="ltr_account" Text="계정" runat="server" /></td>
					<td class="lbl_c" width="18%"><asp:Literal id="ltr_curr_amount" Text="현재금액" runat="server" /></td>
					<td class="lbl_c" width="18%"><asp:Literal id="ltr_bank_balance" Text="은행잔액" runat="server" /></td>
					<td class="lbl_c" width="18%"><asp:Literal id="ltr_bank_interest" Text="이자" runat="server" /></td>
				</tr>
				<tr id="tr_1" runat="server">
					<td class="ctl" style="text-align:center;"><input id="cb_check_1" class="cb" type="checkbox" runat="server" /></td>
					<td class="ctl"><asp:Label ID="lbl_account_nm_1" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="text-align:right;padding:0 2px 0 0;"><asp:Label ID="lbl_curr_amount_1" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="padding:1px;"><asp:TextBox ID="txt_bank_amount_1" CssClass="ib_b_R" Width="95%" runat="server"></asp:TextBox></td>
					<td class="ctl" style="text-align:right;padding:1px;"><asp:TextBox ID="txt_interest_1" CssClass="ib_read_only_R" Width="95%" runat="server"></asp:TextBox></td>
				</tr>
				<tr id="tr_2" runat="server">
					<td class="ctl" style="text-align:center;"><input id="cb_check_2" class="cb" type="checkbox" runat="server" /></td>
					<td class="ctl"><asp:Label ID="lbl_account_nm_2" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="text-align:right;padding:0 2px 0 0;"><asp:Label ID="lbl_curr_amount_2" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="padding:1px;"><asp:TextBox ID="txt_bank_amount_2" CssClass="ib_b_R" Width="95%" runat="server"></asp:TextBox></td>
					<td class="ctl" style="text-align:right;padding:1px;"><asp:TextBox ID="txt_interest_2" CssClass="ib_read_only_R" Width="95%" runat="server"></asp:TextBox></td>
				</tr>
				<tr id="tr_3" runat="server">
					<td class="ctl" style="text-align:center;"><input id="cb_check_3" class="cb" type="checkbox" runat="server" /></td>
					<td class="ctl"><asp:Label ID="lbl_account_nm_3" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="text-align:right;padding:0 2px 0 0;"><asp:Label ID="lbl_curr_amount_3" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="padding:1px;"><asp:TextBox ID="txt_bank_amount_3" CssClass="ib_b_R" Width="95%" runat="server"></asp:TextBox></td>
					<td class="ctl" style="text-align:right;padding:1px;"><asp:TextBox ID="txt_interest_3" CssClass="ib_read_only_R" Width="95%" runat="server"></asp:TextBox></td>
				</tr>
				<tr id="tr_4" runat="server">
					<td class="ctl" style="text-align:center;"><input id="cb_check_4" class="cb" type="checkbox" runat="server" /></td>
					<td class="ctl"><asp:Label ID="lbl_account_nm_4" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="text-align:right;padding:0 2px 0 0;"><asp:Label ID="lbl_curr_amount_4" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="padding:1px;"><asp:TextBox ID="txt_bank_amount_4" CssClass="ib_b_R" Width="95%" runat="server"></asp:TextBox></td>
					<td class="ctl" style="text-align:right;padding:1px;"><asp:TextBox ID="txt_interest_4" CssClass="ib_read_only_R" Width="95%" runat="server"></asp:TextBox></td>
				</tr>
				<tr id="tr_5" runat="server">
					<td class="ctl" style="text-align:center;"><input id="cb_check_5" class="cb" type="checkbox" runat="server" /></td>
					<td class="ctl"><asp:Label ID="lbl_account_nm_5" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="text-align:right;padding:0 2px 0 0;"><asp:Label ID="lbl_curr_amount_5" runat="server" Text=""></asp:Label></td>
					<td class="ctl" style="padding:1px;"><asp:TextBox ID="txt_bank_amount_5" CssClass="ib_b_R" Width="95%" runat="server"></asp:TextBox></td>
					<td class="ctl" style="text-align:right;padding:1px;"><asp:TextBox ID="txt_interest_5" CssClass="ib_read_only_R" Width="95%" runat="server"></asp:TextBox></td>
				</tr>
			</table>
			<!-- 디테일 끝 -->
			<!-- 리스트셋 시작 -->
			<!-- 리스트셋 끝 -->
			<!-- 설명 시작 -->
			<ucComment:Comment id="Comment" TagPrefixs="Mny4011b" runat="server"></ucComment:Comment>
			<!-- 설명 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
				<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
			</div>
			<!-- 히든값 끝 -->
			<act:FilteredTextBoxExtender ID="fte_txt_bank_amount_1"
				runat="server"
				TargetControlID="txt_bank_amount_1"
				FilterType="Custom, Numbers"
				ValidChars=",">
			</act:FilteredTextBoxExtender>
			<act:FilteredTextBoxExtender ID="fte_txt_bank_amount_2"
				runat="server"
				TargetControlID="txt_bank_amount_2"
				FilterType="Custom, Numbers"
				ValidChars=",">
			</act:FilteredTextBoxExtender>
			<act:FilteredTextBoxExtender ID="fte_txt_bank_amount_3"
				runat="server"
				TargetControlID="txt_bank_amount_3"
				FilterType="Custom, Numbers"
				ValidChars=",">
			</act:FilteredTextBoxExtender>
			<act:FilteredTextBoxExtender ID="fte_txt_bank_amount_4"
				runat="server"
				TargetControlID="txt_bank_amount_4"
				FilterType="Custom, Numbers"
				ValidChars=",">
			</act:FilteredTextBoxExtender>
			<act:FilteredTextBoxExtender ID="fte_txt_bank_amount_5"
				runat="server"
				TargetControlID="txt_bank_amount_5"
				FilterType="Custom, Numbers"
				ValidChars=",">
			</act:FilteredTextBoxExtender>
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>
<div class="hdn">
	<input type="hidden" id="lbl_account_1" value="" runat="server" />
	<input type="hidden" id="lbl_account_2" value="" runat="server" />
	<input type="hidden" id="lbl_account_3" value="" runat="server" />
	<input type="hidden" id="lbl_account_4" value="" runat="server" />
	<input type="hidden" id="lbl_account_5" value="" runat="server" />
	<input type="hidden" id="h_total_row_count" value="0" runat="server" />
</div>
<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">

	//이자계산 = 은행잔액 - 현재금액
	function calcInterest(idx) {
		var lbl_curr_amt = Number(delComma($("lbl_curr_amount_" + idx).innerHTML)); //현재금액
		var txt_curr_amt = Number(delComma($("txt_bank_amount_" + idx).value)); //은행잔액

		if (lbl_curr_amt > 0){
			$("txt_interest_" + idx).value = addComma((txt_curr_amt - lbl_curr_amt) + "");
		}
	}
	
	//마감
	function chkSave() {
		var is_checked = false;
		for (var i = 1; i <= 5; i++) {
			chk = "cb_check_" + i;
			if ($(chk) == null) {
				i++;
			}else{
				if ($(chk).checked) {
					is_checked = true;
				}
			}
		}

		if ($F(h_total_row_count) > 0 && !is_checked) {
			msgBox.alert(getMsg(MSG_ERR_152)); //하나이상의 항목을 선택하세요
			return false;
		}

		msgBox.confirm(getMsg(MSG_CFM_020), doFinish); //마감하시겠습니까?
		return false;
	}

	//취소
	function chkCancel() {
		var ls_base_ym = $F("ddl_year") + "년 " + $F("ddl_month") + "월";

		msgBox.confirm(getMsg(MSG_CFM_027, [ls_base_ym]), doCancel); //마감취소하시겠습니까?\n@
		return false;
	}

</script>
</body>
</html>